import packageJson from '../package.json';
import { fontBuilder } from './utils/commonSetting';

const { name, version } = packageJson;
export default {
  code: name,
  version,
  width: 800,
  height: 200,
  coordinate: {
    x: 0,
    y: 0,
  },
  config: [
    {
      name: '视频设置',
      code: 'videoConfig',
      children: [
        {
          name: '同时播放路数',
          unit: '路',
          min: 1,
          max: 6,
          value: '2',
          code: 'maxPlay',
          type: 'InputNumber',
        },
        {
          name: '星眸视频配置',
          code: 'eyesConfig',
          type: 'eyesTreeSelect',
          value: '-1',
        },
      ],
    },
    {
      name: '描述设置',
      code: 'describeConfig',
      children: [
        {
          name: '显示描述',
          code: 'describeShow',
          type: 'CheckBox',
          value: true,
        },
        {
          name: '对齐方式',
          code: 'textAlign',
          value: 'left',
          type: 'Radio',
          enumValue: [
            { key: '居左', value: 'left' },
            { key: '居中', value: 'center' },
            { key: '居右', value: 'right' },
          ],
        },
        fontBuilder({ code: 'describeFont' }),
        {
          name: '描述高度',
          unit: 'px',
          min: 10,
          max: 80,
          value: '32',
          code: 'describeHeight',
          type: 'InputNumber',
        },
        {
          name: '边框粗细',
          unit: 'px',
          min: 0,
          max: 10,
          value: '1',
          code: 'describeBorder',
          type: 'InputNumber',
        },
        { name: '边框颜色', code: 'borderColor', value: 'rgba(27, 100, 238, 0.85)', type: 'ColorSelector' },
        { name: '背景颜色', code: 'bgColor', value: 'rgba(0, 0, 0, 0)', type: 'ColorSelector' },
      ],
    },
    {
      name: '轮播设置',
      code: 'cycleConfig',
      children: [
        {
          name: '开启轮播',
          code: 'turnOnCycle',
          type: 'CheckBox',
          value: true,
        },
        {
          name: '间隔时间',
          unit: '秒',
          min: 20,
          max: 300,
          value: '30',
          code: 'gapTime',
          type: 'InputNumber',
        },
      ],
    },
    {
      name: '缩放设置',
      code: 'zoomConfig',
      children: [
        {
          name: '开启缩放',
          code: 'turnOnZoom',
          type: 'CheckBox',
          value: true,
        },
        {
          name: '预览缩放效果',
          code: 'previewZoom',
          type: 'CheckBox',
          value: false,
        },
        {
          name: '组件宽度',
          unit: 'px',
          min: 100,
          value: '800',
          code: 'zoomWidth',
          type: 'InputNumber',
        },
        {
          name: '组件高度',
          unit: 'px',
          min: 100,
          value: '500',
          code: 'zoomHeight',
          type: 'InputNumber',
        },
        {
          name: '组件位置',
          code: 'comPosition',
          type: 'ChangeConfig',
          value: {
            type: 'center',
            xPosition: '200',
            yPosition: '100',
          },
          enumValue: [
            {
              key: '居中',
              value: 'center',
            },
            {
              key: '自定义',
              value: 'custom',
              change: [
                {
                  name: '横坐标',
                  unit: 'px',
                  code: 'xPosition',
                  type: 'InputNumber',
                },
                {
                  name: '纵坐标',
                  unit: 'px',
                  code: 'yPosition',
                  type: 'InputNumber',
                },
              ],
            },
          ],
        },
      ],
    },
  ],
  data: {
    field: [
      { name: 'id', mapper: 'id' },
      { name: 'title', mapper: 'title' },
      { name: 'url', mapper: 'url' },
    ],
    type: 1,
    value: JSON.stringify([
      {
        id: 'a',
        title: '经海路地铁口',
        url: '',
      },
      {
        id: 'b',
        title: '京东总部一号楼枪机',
        url: '',
      },
    ]),
  },
  events: {},
};
